package asionreachel.cn.smarthomedemo.data;


import java.util.ArrayList;

import asionreachel.cn.smarthomedemo.activity.DeviceListActivity;


public class CAllDeviceInfoList {
    public static CAllDeviceInfoList s_Instance = new CAllDeviceInfoList();

    public static CAllDeviceInfoList GetInstance() {
        return s_Instance;
    }

    public CAllDeviceInfoList() {
    }

    //通知设备数据更改
    public void notifyDeviceInfoChange( CDeviceItem a_itemDevice )
    {
        DeviceListActivity.getInstance().addDeviceItem( a_itemDevice );
        DeviceListActivity.getInstance().notifyDataChanged();
    }

    public void notifyDeviceInfoChange(ArrayList<CDeviceItem> a_listDeviceItem )
    {
        DeviceListActivity.getInstance().clearDeviceItems();
        for( int i = 0 ; i < a_listDeviceItem.size() ; ++i )
            DeviceListActivity.getInstance().addDeviceItem( a_listDeviceItem.get( i ) );
        DeviceListActivity.getInstance().notifyDataChanged();
    }
}